package com.hgf.helper.mybatisplusdemo.db.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.hgf.helper.mybatisplus.HBaseMapper;
import com.hgf.helper.mybatisplus.annotation.SelectTargetResult;
import com.hgf.helper.mybatisplus.join.JoinLambdaQueryWrapper;
import com.hgf.helper.mybatisplusdemo.db.entity.Student;
import com.hgf.helper.mybatisplusdemo.pojo.vo.ResultVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StudentMapper extends HBaseMapper<Student> {

    @SuppressWarnings(value = "unchecked")
    @SelectTargetResult
    ResultVo getResultVo(@Param(Constants.WRAPPER) JoinLambdaQueryWrapper<Student> lambdaQueryWrapper);

    @SelectTargetResult
    List<ResultVo> listResultVos(@Param(Constants.WRAPPER) JoinLambdaQueryWrapper<Student> lambdaQueryWrapper);

    @SelectTargetResult(value = ResultVo.class)
    <E extends IPage<ResultVo>, K> E selectJoinResultPage(K page, @Param(Constants.WRAPPER) JoinLambdaQueryWrapper<Student> queryWrapper);

}
